<?php if (!defined('THINK_PATH')) exit();?><div class="bjui-pageHeader">
    <ul class="nav nav-tabs" role="tablist">
        <li class="active"><a href="#pro_home" role="tab" data-toggle="tab">基本信息</a></li>
        <li><a href="<?php echo U('Forms/proone',array('id'=>$va['id']));?>" role="tab" data-toggle="ajaxtab" data-target="#pro_content" data-reload="false">详情介绍</a></li>
        <li><a href="<?php echo U('Forms/protwo',array('id'=>$va['id']));?>" role="tab" data-toggle="ajaxtab" data-target="#pro_attr" data-reload="false">模型参数</a></li>
       <!--  <li><a href="<?php echo U('Forms/prothree',array('id'=>$va['id']));?>" role="tab" data-toggle="ajaxtab" data-target="#pro_aftersale" data-reload="false">售后</a></li> -->
    </ul>
</div>
<div class="bjui-pageContent">
    <form action="<?php echo U('save_goods');?>"  data-toggle="validate" data-alertmsg="false" class="navtabForm">
        <input type="hidden" name="id" value="<?php echo ($va["id"]); ?>"/>
        <div class="tab-content">
            <div class="tab-pane fade active in" id="pro_home">
                <div class="form-group">
                    <label class="x100">产品名称:</label>
                    <input type="text" name=name data-rule="required" value="<?php echo ($va["name"]); ?>"/>
                </div>
                <div class="form-group">
                    <label class="x100">副标题:</label>
                    <textarea name="two_name" class="w400"><?php echo ($va["two_name"]); ?></textarea>
                </div>
                <div class="form-group">
                    <label class="x100">产品货号:</label>
                    <input type="text" name="goods_no" data-rule="required" value="<?php echo $va['goods_no']?$va['goods_no']:goods_no() ?>"/>
                </div>
                <div class="form-group">
                    <label class="x100">价格:</label>
                    <input type="text" name="price" data-rule="required" value="<?php echo ($va["price"]); ?>"/>元
                </div>
                <div class="form-group">
                    <label class="x100">所属类型:</label>
                    <select name="commend_id" data-toggle="selectpicker" data-nextselect="#groy-type2" data-refurl="<?php echo U('Index/getclass');?>?v={value}">
                        <option value="0">--请选择--</option>
                        <?php if(is_array($commend)): $i = 0; $__LIST__ = $commend;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$co): $mod = ($i % 2 );++$i;?><option value="<?php echo ($co["id"]); ?>" <?php if($co['id'] == $va['commend_id']): ?>selected<?php endif; ?>><?php echo ($co["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                </div>
                <div class="form-group">
                    <label class="x100">商品分类:</label>
                    <select name="category_id[]" data-toggle="selectpicker" multiple data-width="400" id="groy-type2">
                        <option value="">--请选择--</option>
                        <?php if($va["category_ids"] != null): if(is_array($va['category_ids'])): $i = 0; $__LIST__ = $va['category_ids'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vaa): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vaa["id"]); ?>" <?php if($vaa["ck"] == '1'): ?>selected<?php endif; ?>><?php echo ($vaa["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; endif; ?>
                        <!-- <?php if(is_array($res)): $i = 0; $__LIST__ = $res;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$ro): $mod = ($i % 2 );++$i;?><option value="<?php echo ($ro["id"]); ?>" <?php if(in_array($ro['id'],$va['category_ids'])): ?>selected<?php endif; ?>><?php echo ($ro["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?> -->
                    </select>
                </div>
                <div class="form-group place">
                    <label class="x100">场地坐标:</label>
                    <input type="text" name="east"  <?php if($va["north"] != null): ?>value="<?php echo ($va["east"]); ?>,<?php echo ($va["north"]); ?>"<?php endif; ?>/>
                    <span>注意：当类型为场地租赁的时候，此处必须要填。</span>
                    <span><a href="http://api.map.baidu.com/lbsapi/getpoint/index.html" target="_blank">获取经纬度</a></span>
                </div>
                <div class="form-group">
                    <label class="x100">服务城市:</label>
                    <select name="city_id[]" data-toggle="selectpicker" multiple data-width="400">
                        <option value="">--请选择--</option>
                        <?php if(is_array($city)): $i = 0; $__LIST__ = $city;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$to): $mod = ($i % 2 );++$i;?><option value="<?php echo ($to["id"]); ?>" <?php if(in_array($to['id'],$va['city_ids'])): ?>selected<?php endif; ?>><?php echo ($to["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                </div>
                <div class="form-group">
                    <label class="x100">所属商家:</label>
                    <select name="sid" data-toggle="selectpicker">
                        <option value="0">--请选择--</option>
                        <?php if(is_array($shoplist)): $i = 0; $__LIST__ = $shoplist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$so): $mod = ($i % 2 );++$i;?><option value="<?php echo ($so["id"]); ?>" <?php if($so['id'] == $va['sid']): ?>selected<?php endif; ?>><?php echo ($so["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                </div>
                <div class="form-group">
                    <label class="x100">产品品牌:</label>
                    <select name="brandid" data-toggle="selectpicker">
                        <option value="0">--请选择--</option>
                        <?php if(is_array($brandlist)): $i = 0; $__LIST__ = $brandlist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$bo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($bo["id"]); ?>" <?php if($bo['id'] == $va['brandid']): ?>selected<?php endif; ?>><?php echo ($bo["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                </div>
               <!--  <div class="form-group">
                    <label class="x100">所属类型:</label>
                    <?php if(is_array($commend)): $i = 0; $__LIST__ = $commend;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$co): $mod = ($i % 2 );++$i;?><input type="radio" name="commend_id" value="<?php echo ($co["id"]); ?>" id="stssale2" data-toggle="icheck" data-label="<?php echo ($co["name"]); ?>" <?php if($va['commend_id'] == $co['id']): ?>checked<?php endif; ?>  /><?php endforeach; endif; else: echo "" ;endif; ?>
                </div> -->
                <div class="form-group">
                    <label class="x100">商品状态:</label>
                    <input type="radio" name="status" value="0" id="pro_status1" data-toggle="icheck" data-label="上架"  <?php if($va["status"] != '1'): ?>checked<?php endif; ?>  />
                    <input type="radio" name="status" value="1" id="pro_status2" data-toggle="icheck" data-label="下架"  <?php if($va["status"] == '1'): ?>checked<?php endif; ?>  />
                </div>
                <!-- <div class="form-group">
                    <label class="x100">是否包邮:</label>
                    <input type="radio" name="bemail" id="pro_beamil1" data-toggle="icheck" data-label="是"  checked  />
                    <input type="radio" name="bemail" id="pro_beamil2" data-toggle="icheck" data-label="否"   />
                </div> -->
                
                <div class="form-group">
                    <label class="x100">权重:</label>
                    <input type="text" name="sort" value="<?php echo ($va["sort"]); ?>" data-toggle="spinner" data-min="0" data-step="1" data-rule="integer" class="w100"  />
                </div>
               <!--  <div class="form-group ">
                    <label class="x100">商品关键词:</label>
                    <input type="text" name="search_words" class="w500" value="<?php echo ($va["search_words"]); ?>"/>
                    <span class="text-warning">注:使用豆号分隔</span>
                </div> -->
                <div class="form-group clearfix">
                    <label class="x100 pull-left">商品图片:</label>
                    <div class="pull-left">
                        <!--多上传dom ,-->
                        <!-- data-name   hidden的name    组合后 name[] -->
                        <div class="multimg clearfix" data-name="photo">
                            <?php if($va["photo"] != null): if(is_array($va['photo'])): $i = 0; $__LIST__ = $va['photo'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$po): $mod = ($i % 2 );++$i;?><div class="pull-left"><img src="<?php echo ($po); ?>" width="70"><input type="hidden" name="photo[]" value="<?php echo ($po); ?>"><p class="text-center"><a href="javascript:void(0)" class="remove">删除</a></p></div><?php endforeach; endif; else: echo "" ;endif; endif; ?>
                        </div>
                        <span data-toggle="upload"
                        data-uploader="<?php echo U('Index/upload');?>"
                         data-file-type-exts="*.png;*.jpg"
                         data-icon="cloud-upload"
                         data-multi="true"
                         data-on-upload-success="upload_multi_callback"
                         data-auto="true"
                         data-button-text="上传图片"
                        ></span>
                        <span>注：第一张图片为主图</span>
                    </div>
                </div>
            </div>
            <div class="tab-pane fade" id="pro_content"></div>
            <div class="tab-pane fade" id="pro_attr"></div>
            <div class="tab-pane fade" id="pro_aftersale"></div>
        </div>




    </form>
</div>
<script>
$(function () {
   $('.multimg').on('click', 'a.remove', function () {
        $(this).parents('div.pull-left').eq(0).remove();
   });
});
</script>

<div class="bjui-pageFooter">
		
	<?php if(save == save): ?><ul>
			<li><button type="submit" class="btn-default" data-icon="save">保存</button></li>
	        <li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
	    </ul>
	<?php elseif(save == close): ?>
	    <ul>
	        <li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
	    </ul>
	<?php elseif(save == page and $show != null): ?>
		<ul>
	        <li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
	    </ul>
		    <div class="pages">
		        <span>每页&nbsp;</span>
		        <div class="selectPagesize">
		            <select data-toggle="selectpicker" data-toggle-change="changepagesize">
		                <option value="<?php echo ($show['listrow']); ?>"><?php echo ($show['listrow']); ?></option>
		                <option value="60">60</option>
		                <option value="120">120</option>
		                <option value="150">150</option>
		            </select>
		        </div>
		        <span>&nbsp;条，共 <?php echo ($show['total']); ?> 条</span>
		    </div>
		    <div class="pagination-box" data-toggle="pagination" data-total="<?php echo ($show['total']); ?>" data-page-size="<?php echo ($show['listrow']); ?>" data-page-current="1">
		    </div>
	<?php elseif(save == page and $show == null): ?>
		<ul>
			<li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
		</ul>
	<?php else: ?>
		<ul>
			<li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
		</ul><?php endif; ?>

</div>